package com.mf.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 转账记录
 * </p>
 *
 * @author mf
 * @since 2024-06-08
 */
@Getter
@Setter
@TableName("t_user_transfer_record")

public class UserTransferRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户id
     */
    @NotNull(message = "用户id不能为空")
    private Integer userId;

    /**
     * 交易金额
     */
    @NotNull(message = "金额不能为空")
    @DecimalMin(value = "1", message = "金额必须大于0")
    private BigDecimal amount;

    /**
     * 交易类型 in:转入,out:转出
     */
    @NotBlank(message = "交易类型不能为空")
    private String type;

    private LocalDateTime createdTime;

    private LocalDateTime updateTime;
}